import React, { Component } from 'react'
import {withRouter} from 'react-router-dom'
class CinemaItem extends Component {
    goDes=(item)=>{
        this.props.history.push(`/moviedes/${item.movieId}/${item.movieInfo.title}`)
        this.props.recordDes(item)
    }
    render() {
        let { movielist } = this.props
        return (
            <>
                <ul>
                    {
                        movielist.map(item => {
                            return (
                                <li key={item.movieId} onClick={()=>this.goDes(item)}>
                                    <div>
                                        <img src={item.poster} alt="" />
                                    </div>
                                    <div className="xiXi">
                                        <h4>{item.movieInfo.title}</h4>
                                        <p >{item.movieInfo.englishTitle}</p>
                                        <p>{item.movieInfo.actors}</p>
                                        <p>{item.movieInfo.showInfo}</p>
                                    </div>
                                    <div className="fen">
                                        <p><span className="fenCe">{item.score === '' ? '暂无评' : item.score}分</span></p>
                                    </div>
                                </li>
                            )
                        })
                    }
                </ul>
            </>
        )
    }
}
export default withRouter(CinemaItem)